import axios from "axios";
export default class Store {
  constructor() {
    this.musicMes = {};//音乐播放器需要的歌曲信息，歌曲id从哪来
    this.isPlay = false;
    this.isFullPlay = false;
    this.songMes = {};//mini播放器所需要的歌曲信息
    this.playingList=[];//当前播放歌曲的播放列表
    this.currentTime = null;//当前歌曲的播放进度
    this.ind = null;//播放列表的循环方式
  }
  setData(music_id,music_from,song_sheet_id) {
    this.musicMes = {
      music_id:music_id,

    };
    this.musicMes.music_from = music_from;
    if(music_from == 3){
      this.musicMes.song_sheet_id = song_sheet_id;
    }else if(music_from == 4){
      this.musicMes.list_category_name = song_sheet_id;
    }else{
      this.musicMes.music_id = music_id;
      this.musicMes.music_from = music_from;
    }
    window.localStorage.setItem('musicMes', JSON.stringify(this.musicMes));
    return this.musicMes;
  }
}